#include "tash.hpp"

int main()
{
    creator_task(vt);
    
    srand(time(0));
    vector<process> vpr;
    creator_pp(vpr);
    test(vpr);
    cout<<"主进程开始给子进程分配任务"<<endl;
    sleep(2);

    for (int i = 0; i < 5; i++)
    {
        int proc_num = rand()%N;//随机子进程-vpr下标
        int task_num = rand()%4;//随机任务
        write(vpr[proc_num].fd_,&task_num,sizeof(int));
        sleep(1);
    }
    
    clear(vpr);
    return 0;
}